<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>主界面</title>
    <link rel="shortcut icon" type="image/x-icon" href="./img/favicon.ico">
    <link rel="stylesheet" href="../../element-theme/blue/index.css">
    <link rel="stylesheet" href="../../css/aui-blue.min.css">

    <style>
        iframe {
            width: 100%;
            height: 894px;
            overflow: auto;
            border: none;
            display: block;
            font-size: 0;
        }

        .el-tabs__content {
            padding: 0 !important;
        }

        .el-tab-pane {
            padding: 0 !important;
        }
    </style>
</head>

<body>
<div v-cloak class="aui-wrapper" :class="[
      'aui-header--' + appearance.headerSkin,
      'aui-aside--' + appearance.asideSkin,
      {
        'aui-header--fixed': appearance.headerFixed,
        'aui-aside--fixed': appearance.asideFixed,
        'aui-aside--fold': asideFold,
        'aui-aside-control--fixed': appearance.asideControlFixed,
        'aui-aside-control--open': asideControlOpen,
        'aui-main-tabs__header--fixed': appearance.mainTabsHeaderFixed
      }
    ]" v-loading.fullscreen.lock="loading" element-loading-text="拼命加载中">
    <template v-if="!loading">
        <!-- aui-header -->
        <header class="aui-header">
            <div class="aui-header__hd">
                <a class="aui-brand aui-brand--lg" href="javascript:;">输血管理系统</a>
                <a class="aui-brand aui-brand--sm" href="javascript:;">展开</a></a>
            </div>
            <div class="aui-header__bd">
                <!-- aui-header__menu left -->
                <el-menu class="aui-header__menu aui-header__menu--left" mode="horizontal">
                    <el-menu-item index="1" @click="asideFold = !asideFold">
                        <svg class="icon-svg aui-header__icon-menu aui-header__icon-menu--rz180" aria-hidden="true">
                            <use xlink:href="#icon-outdent"></use>
                        </svg>
                    </el-menu-item>
                </el-menu>
                <!-- aui-header__menu right -->
                <el-menu class="aui-header__menu aui-header__menu--right" mode="horizontal">
                    <!--                    <el-menu-item index="3" @click="refresh">-->
                    <!--                        <svg class="icon-svg aui-header__icon-menu" aria-hidden="true">-->
                    <!--                            <use xlink:href="#icon-sync"></use>-->
                    <!--                        </svg>-->
                    <!--                    </el-menu-item>-->
                    <el-menu-item index="3" @click="refresh">
                        <svg class="icon-svg aui-header__icon-menu" aria-hidden="true">
                            <use xlink:href="#icon-sync"></use>
                        </svg>
                    </el-menu-item>
                    <el-menu-item index="4" @click="asideControlOpen = !asideControlOpen">
                        <svg class="icon-svg aui-header__icon-menu" aria-hidden="true">
                            <use xlink:href="#icon-setting"></use>
                        </svg>
                    </el-menu-item>
                    <!--                    <el-submenu index="5" :popper-append-to-body="false">-->
                    <!--                        <template slot="title">常用选项</template>-->
                    <!--                        <el-menu-item index="5-1">选项1</el-menu-item>-->
                    <!--                        <el-menu-item index="5-2">选项2</el-menu-item>-->
                    <!--                        <el-menu-item index="5-3">选项3</el-menu-item>-->

                    <!--                    </el-submenu>-->
                    <!--                        <el-menu-item index="1" @click="searchVisible = !searchVisible" ref="auiSearchMenu">-->
                    <!--                            <svg class="icon-svg aui-header__icon-menu" aria-hidden="true">-->
                    <!--                                <use xlink:href="#icon-search"></use>-->
                    <!--                            </svg>-->
                    <!--                        </el-menu-item>-->
                    <!--                        <el-submenu index="2" :popper-append-to-body="false" class="not-arrow t-center">-->
                    <!--                            <template slot="title">-->
                    <!--                                <el-button size="mini">简体中文</el-button>-->
                    <!--                            </template>-->
                    <!--                            <el-menu-item index="2-1">简体中文</el-menu-item>-->
                    <!--                            <el-menu-item index="2-2">繁體中文</el-menu-item>-->
                    <!--                            <el-menu-item index="2-3">English</el-menu-item>-->
                    <!--                        </el-submenu>-->
                    <el-submenu index="2" :popper-append-to-body="false">
                        <template slot="title">
                            <img class="aui-avatar" src="../../img/avatar_1.jpg">
                            <span>{{user.jobnum}}</span>
                        </template>
                        <el-menu-item index="3-1" @click="personmsg">个人信息</el-menu-item>
                        <el-menu-item index="3-2" @click="exit()">退出</el-menu-item>
                    </el-submenu>
                </el-menu>
                <!-- aui-search -->
                <div class="aui-search" :class="{ 'aui-search--show': searchVisible }" ref="auiSearch">
                    <div class="aui-search__inner">
                        <el-input class="aui-search__input" v-model="search" placeholder="搜索关键字" clearable>
                            <svg slot="prepend" class="icon-svg" aria-hidden="true">
                                <use xlink:href="#icon-search"></use>
                            </svg>
                        </el-input>
                    </div>
                </div>
            </div>
        </header>
        <!-- aui-aside -->
        <aside class="aui-aside">
<!--            :collapse="asideFold"-->
            <div class="aui-aside__inner">
                <el-menu class="aui-aside__menu" :default-active="asideMenuActive"
                         :unique-opened="true" :collapse-transition="false">
                    <admin-menu :menuData="user.menuUrls.menu" @new-tab="addNewTab"></admin-menu>

                </el-menu>
            </div>
        </aside>


        <!-- aui-aside-control -->
        <aside class="aui-aside-control">
            <!--            <div class="aui-aside-control__toggle" @click="asideControlOpen = !asideControlOpen">-->
            <!--                <svg class="icon-svg" aria-hidden="true">-->
            <!--                    <use xlink:href="#icon-setting"></use>-->
            <!--                </svg>-->
            <!--            </div>-->
            <div class="aui-aside-control__inner">
                <div class="aui-aside-control__bd">
                    <el-tabs class="aui-tabs aui-tabs--flex" v-model="asideControlTabsActive">
                        <el-tab-pane label="布局" name="layout">
                            <dl class="aui-aside-control__setting">
                                <dt>Header</dt>
                                <dd>
                                    <el-checkbox v-model="appearance.headerFixed">Fixed 固定</el-checkbox>
                                </dd>
                                <dd>
                                    <el-checkbox v-model="appearance.headerSkin" true-label="colorful"
                                                 false-label="white">
                                        Colorful
                                        鲜艳
                                    </el-checkbox>
                                </dd>
                            </dl>
                            <dl class="aui-aside-control__setting">
                                <dt>Aside</dt>
                                <dd>
                                    <el-checkbox v-model="appearance.asideFixed">Fixed 固定</el-checkbox>
                                </dd>
                                <dd>
                                    <el-checkbox v-model="appearance.asideSkin" true-label="dark" false-label="white">
                                        Dark 鲜艳
                                    </el-checkbox>
                                </dd>
                            </dl>
                            <dl class="aui-aside-control__setting">
                                <dt>Aside-control</dt>
                                <dd>
                                    <el-checkbox v-model="appearance.asideControlFixed">Fixed 固定</el-checkbox>
                                </dd>
                            </dl>

                            <dl class="aui-aside-control__setting">
                                <dt>Main-tabs</dt>
                                <dd>
                                    <el-checkbox v-model="appearance.mainTabsHeaderFixed">Header Fixed 固定
                                    </el-checkbox>
                                </dd>
                            </dl>
                            <dl class="aui-aside-control__setting">
                                <dt></dt>
                                <dd>
                                    <el-button @click="savepersonality">保存设置</el-button>
                                    <el-button @click="savepersonality">推出</el-button>

                                </dd>
                            </dl>

                        </el-tab-pane>

                        <el-tab-pane label="皮肤" name="skins">
                            <dl class="aui-aside-control__setting">
                                <dt><span>  主题颜色</span></dt>
                                <dd v-for="item in skinList" :key="item.name">
                                    <el-radio v-model="appearance.skin" :label="item.name" @change="skinChangeHandle">
                                        <span class="t-capitalize"></span> {{ item.remark }}
                                    </el-radio>
                                </dd>
                            </dl>
                            <dl class="aui-aside-control__setting">
                                <dt></dt>
                                <dd>
                                    <el-button @click="savepersonality">保存设置</el-button>
                                    <el-button @click="savepersonality">推出</el-button>
                                </dd>
                            </dl>
                        </el-tab-pane>
                    </el-tabs>
                </div>
            </div>
        </aside>
        <!-- aui-main -->
        <main class="aui-main">
            <el-dropdown class="aui-main-tabs__tool" @command="handleCommand">
                <i class="el-icon-arrow-down"></i>
                <el-dropdown-menu slot="dropdown">
                    <el-dropdown-item command="current">关闭当前标签页</el-dropdown-item>
                    <el-dropdown-item command="other">关闭其它标签页</el-dropdown-item>
                    <el-dropdown-item command="all">关闭全部标签页</el-dropdown-item>
                </el-dropdown-menu>
            </el-dropdown>
            <el-tabs class="aui-main-tabs aui-tabs" v-model="mainTabsActive" @tab-remove="removeTab">
                <el-tab-pane label="标签页2" name="home" :closable="false">
                    <svg slot="label" class="aui-content--tabs-icon-nav icon-svg" aria-hidden="true">
                        <use xlink:href="#icon-home"></use>
                    </svg>
                    <iframe src="home.html" id="home" :width="iframeset.width" :height="iframeset.height"></iframe>
                </el-tab-pane>
                <el-tab-pane v-for="(item,index) in mainTabs" :key="index" :label="item.label" :name="item.name"
                             closable>
                    <i :class="item.iconClass"></i>
                    <iframe :src="item.url" :id="item.name" :width="iframeset.width" :height="iframeset.height"></iframe>

                </el-tab-pane>
                <!--          <el-tab-pane label="标签页3" name="3" closable>标签页3</el-tab-pane>-->
                <!--          <el-tab-pane label="标签页5" name="5" closable>-->
                <!--            <span slot="label"><i class="el-icon-date"></i> 标签页5</span>-->
                <!--          </el-tab-pane>-->
                <!--          <el-tab-pane label="标签页6" name="6" closable>标签页6</el-tab-pane>-->
                <!--          <el-tab-pane label="标签页7" name="7" closable>标签页7</el-tab-pane>-->
                <!--          <el-tab-pane label="标签页8" name="8" closable>标签页8</el-tab-pane>-->
                <!--          <el-tab-pane label="标签页9" name="9" closable>标签页9</el-tab-pane>-->
                <!--          <el-tab-pane label="标签页10" name="10" closable>标签页10</el-tab-pane>-->
            </el-tabs>
        </main>
        <!-- aui-footer -->
        <footer class="aui-footer">
            <p>MingHs</p>
        </footer>
    </template>
</div>
<script src="../../plugins/vue-2.5.17/vue.js"></script>
<script src="../../plugins/element-2.4.5/index.js"></script>
<script src="../../icons/iconfont.js"></script>
<script src="../../js/HttpVueLoader.js"></script>
<!--<script src="https://unpkg.com/http-vue-loader"></script>-->
<script src="../../js/jquery.min.js"></script>

<script>Vue.prototype.$ELEMENT = {size: 'medium'};</script>
<script type="text/javascript">
    (function () {
        var vm = window.vm = new Vue({
            el: '.aui-wrapper',
            components: {
                'adminMenu': httpVueLoader('../components/adminMenu.vue')
            },

            data: function () {
                return {
                    user: {
                        "accountNonExpired": true,
                        "accountNonLocked": true,
                        "credentialsNonExpired": true,
                        "enable": false,
                        "enabled": false,
                        "jobnum": "tom",
                        "menuUrls": {
                            "menu": [{
                                "urls": [{
                                    "id": "11",
                                    "title": "11",
                                    "url": "/pages/error/403.html",
                                    "titleflag": "error"
                                }, {
                                    "id": "404",
                                    "title": "12",
                                    "url": "/pages/error/404.html",
                                    "titleflag": "error"
                                }, {
                                    "id": "13",
                                    "title": "13",
                                    "url": "/pages/error/505.html",
                                    "titleflag": "error"
                                }], "title": "testerror", "titleflag": "error"
                            }, {
                                "urls": [{
                                    "id": "21",
                                    "title": "505",
                                    "url": "/pages/error/505.html",
                                    "titleflag": "testerror"
                                }, {
                                    "id": "22",
                                    "title": "5-5",
                                    "url": "/pages/error/505.html",
                                    "titleflag": "testerror"
                                }], "title": "testerror2", "titleflag": "testerror"
                            }]
                        },
                        "noLocked": false,
                        "personalization": {
                            "asideFold": false,
                            "mainTabsHeaderFixed": true,
                            "asideControlOpen": false,
                            "headerSkin": "colorful",
                            "headerFixed": false,
                            "skin": "brown",
                            "asideSkin": "dark",
                            "asideControlFixed": true
                        },
                        "username": "tom"
                    },
                    iframeset:{
                        width:750,
                        height:750,
                    },
                    loading: true,
                    // 侧边, 折叠状态
                    asideFold: false,
                    // 侧边, 菜单选中
                    asideMenuActive: 'home-tabs',
                    // 搜索
                    searchVisible: false,
                    search: '',
                    // 侧边管理控制
                    asideControlOpen: false,
                    asideControlTabsActive: 'layout',
                    // 主标签页
                    mainTabs: [],
                    mainTabsActive: 'home',

                    // 皮肤

                    skinList: [
                        {name: 'blue', color: '#3E8EF7', remark: '蓝色'},
                        {name: 'brown', color: '#997B71', remark: '棕色'},
                        {name: 'cyan', color: '#0BB2D4', remark: '青色'},
                        {name: 'gray', color: '#757575', remark: '灰色'},
                        {name: 'green', color: '#11C26D', remark: '绿色'},
                        {name: 'indigo', color: '#667AFA', remark: '靛青色'},
                        {name: 'orange', color: '#EB6709', remark: '橙色'},
                        {name: 'pink', color: '#F74584', remark: '粉红色'},
                        {name: 'purple', color: '#9463F7', remark: '紫色'},
                        {name: 'red', color: '#FF4C52', remark: '红色'},
                        {name: 'turquoise', color: '#17B3A3', remark: '蓝绿色'},
                        {name: 'yellow', color: '#FCB900', remark: '黄色'}
                    ],
                    indexNoticeTabsActive: '1',
                    indexPersonalTabsActive: '1',

                    appearance: {
                        headerFixed: false,     // 头部, 固定状态
                        headerSkin: 'colorful',      // 头部, 皮肤 (white 白色 / colorful 鲜艳)
                        asideFixed: false,      // 侧边, 固定状态
                        asideSkin: 'dark',      // 侧边, 皮肤 (white 白色 / dark 黑色)
                        asideControlFixed: false,       // 侧边管理控制
                        mainTabsHeaderFixed: false,     // 主标签页
                        skin: 'orange',
                    }
                }
            },

            computed: {

                // isUser() {
                //     let userFlag = false
                //     let permission = this.userInfo.role[0].permission
                //     permission.forEach(item => {
                //         if (item.flag == "user")
                //             userFlag = true
                //     });
                //     return userFlag;
                // },
                // isRole() {
                //     let roleFlag = false
                //     let permission = this.userInfo.role[0].permission
                //     permission.forEach(item => {
                //         if (item.flag == "role")
                //             roleFlag = true
                //     });
                //     return roleFlag;
                // },
                // isAdmin() {
                //     let adminFlag = false
                //     let role = this.userInfo.role[0]
                //     if (role.name = "超级管理员")
                //         adminFlag = true
                //     return adminFlag
                // }
            },


            watch: {
                asideControlTabsActive(){
                    console.log("asideControlTabsActive:" + this.asideControlTabsActive)
                },
                asideMenuActive(){
                    console.log("asideMenuActive:" + this.asideMenuActive)
                },

                headerFixed: function (val) {
                    if (!val) {
                        vm.asideControlFixed = false;
                        vm.mainTabsHeaderFixed = false;
                    }
                },
                asideControlFixed: function (val) {
                    if (val) {
                        vm.headerFixed = true;
                    }
                },
                mainTabsHeaderFixed: function (val) {
                    if (val) {
                        vm.headerFixed = true;
                    }
                }
            },

            beforeCreate() {
                vm = this;
            },

            created() {

                vm.loading = false;
                this.getResolutionRatio();
                // vm.$nextTick(function () {
                // //     // 搜索, 显示／隐藏
                // //     vm.$refs.auiSearchMenu.$el.addEventListener('click', function (e) {
                // //         e.cancelBubble = true;
                // //     });
                //     vm.$refs.auiSearch.addEventListener('click', function (e) {
                //         e.cancelBubble = true;
                //     });
                //     window.addEventListener('click', function (e) {
                //         if (vm.searchVisible) {
                //             vm.searchVisible = false;
                //         }
                //     });
                // });
            },

            methods: {
                getResolutionRatio(){
                    this.iframeset.height = document.documentElement.clientHeight * 0.9;
                    this.iframeset.width = document.documentElement.clientWidth * 0.75;

                },
                getFrameInParent() {
                    var len = parent.document.getElementsByTagName("iframe").length;

                    for (var i = 0; i < len; i++) {
                        console.log(parent.document.getElementsByTagName("iframe")[i].contentWindow.document)
                        if (parent.document.getElementsByTagName("iframe")[i].contentWindow.document === document) {

                            return parent.document.getElementsByTagName("iframe")[i];
                        }
                    }
                },
                personmsg() {
                    const item = {
                        label: "个人信息",
                        name: "个人信息",
                        iconClass: "el-icon-user",
                        url: "/pages/after/personmsg.html"
                    };
                    console.log(item)
                    this.mainTabs.push(item)
                    this.mainTabsActive = item.name


                },

                //局部刷新页面
                refresh() {

                    document.getElementById(this.mainTabsActive).contentWindow.location.reload(true);

                    // console.log("refresh")
                    // // self.location.reload();
                    // var ifram = document.getElementsByTagName("iframe")[0]
                    // console.log(ifram)
                    // // for(i=0;i<iframe.length;i++){
                    // //     //循环获取表单input的值
                    // //     console.log(iframe[i])
                    // //     //循环获取属性的值
                    // //     //alert(arr[i].getAttribute("name"));
                    // // }
                    //
                    // // console.log(JSON.parse(JSON.stringify(this.mainTabs)))
                    // console.log(vm.mainTabsActive)


                },
                //保存个性化设置
                savepersonality() {
                    console.log(this.user)
                    this.user.personalization.headerFixed = this.appearance.headerFixed
                    this.user.personalization.headerSkin = this.appearance.headerSkin // 头部, 皮肤 (white 白色 / colorful 鲜艳)
                    this.user.personalization.asideSkin = this.appearance.asideSkin
                    this.user.personalization.asideControlFixed = this.appearance.asideControlFixed
                    this.user.personalization.mainTabsHeaderFixed = this.appearance.mainTabsHeaderFixed
                    this.user.personalization.asideFold = this.asideFold //侧边不隐藏
                    this.user.personalization.asideControlOpen = false
                    this.user.personalization.skin = this.appearance.skin
                    sessionStorage.setItem("user", JSON.stringify(this.user))

                    $.ajax({
                        url: "/after/savepersonality",
                        type: "POST",
                        contentType: "application/json",
                        data: JSON.stringify(this.user)
                    }).then(res => {
                        if (res.code == 200) {


                            this.$message(
                                {
                                    message: res.msg,
                                    type: "success"
                                }
                            )
                        } else {
                            this.$message(
                                {
                                    message: res.msg,
                                    type: "error"
                                }
                            )
                        }

                    })
                },
                // tab关闭菜单
                handleCommand(command) {
                    const tabs = this.mainTabs;
                    switch (command) {
                        case "other":
                            this.mainTabs = tabs.filter(tab => tab.name === this.mainTabsActive);
                            break
                        case "all":
                            this.mainTabs = [];
                            this.mainTabsActive = "home";
                            break
                        default:
                            this.mainTabs = tabs.filter(tab => tab.name !== this.mainTabsActive);
                            this.mainTabsActive = "home";
                            break
                    }
                },
                // 点击移除菜单时事件
                removeTab(targetName) {
                    let tabs = this.mainTabs;
                    this.mainTabs = tabs.filter(tab => tab.name !== targetName);
                    if (this.mainTabsActive === targetName) {
                        this.mainTabsActive = "home";
                    }
                },


                // userInfo: {
                //     id: 28,
                //     jobnum: "tom1",
                //     idcode: "234",
                //     phone: "1234",
                //     avatar: "logo",
                //
                //     role: [
                //         {
                //             id: 1,
                //             name: "超级管理员",
                //             description: null,
                //             permission: [
                //                 {
                //                     id: 1,
                //                     name: "用户管理",
                //                     path: "./pages/home.html",
                //                     description: "用户管理",
                //                     flag: "user"
                //                 },
                //                 {
                //                     id: 2,
                //                     name: "权限管理",
                //                     path: "./pages/home.html",
                //                     description: "权限管理",
                //                     flag: "role"
                //                 }
                //             ]
                //         }
                //     ]
                // },
                // 子组件adminMenu新增窗口
                addNewTab(item) {
                    let flag = 0;
                    for(let i = 0 ;i < this.mainTabs.length;i++){
                        if(item.name == this.mainTabs.at(i).name){
                            console.log("exist:" + item.name)
                            flag = 1;
                        }
                    }

                    if(flag == 0){
                        this.mainTabs.push(item)
                        console.log(this.mainTabs)
                        this.mainTabsActive = item.name
                        console.log("asideMenuActive :   " + this.asideMenuActive)
                        console.log("mainTabsActive :   " + this.mainTabsActive)
                    }else{
                        this.mainTabsActive = item.name
                    }
                },

                // 跳转页面
                gotoPageHandle: function ($event, url) {

                    // iconClass 应该是根据元素获取的
                    const item = {
                        label: $event.$el.innerText,
                        name: $event.index,
                        iconClass: "el-icon-user",
                        url: url
                    };
                    console.log(item)
                    this.mainTabs.push(item)
                    this.mainTabsActive = item.name
                },
                // 皮肤切换
                skinChangeHandle(val) {
                    console.log(val)
                    var styleList = [
                        {
                            id: 'J_elementTheme',
                            url: '../../element-theme/' + val + '/index.css?t=' + new Date().getTime()
                        },
                        {
                            id: 'J_auiSKin',
                            url: '../../css/aui-' + val + '.min.css?t=' + new Date().getTime()
                        }
                    ]
                    for (var i = 0; i < styleList.length; i++) {
                        var el = document.querySelector('#' + styleList[i].id)
                        if (el) {
                            el.href = styleList[i].url
                            continue
                        }
                        el = document.createElement('link')
                        el.id = styleList[i].id
                        el.href = styleList[i].url
                        el.rel = 'stylesheet'
                        document.querySelector('head').appendChild(el)
                    }
                },
                changepassword() {

                },
                exit() {
                    $.ajax(
                        {
                            url: "/logout",
                            type: "POST",

                        }
                    ).then(res => {
                        if (res.code == 0) {
                            this.$message({
                                type: "success",
                                message: res.msg
                            })
                            setTimeout(() => {
                                window.location.href = '../before/login.html'
                            }, 1000)
                        }
                    })
                }
            },
            mounted() {
                // loading: true,
                //     // 侧边, 折叠状态
                //     asideFold: false,
                //     // 侧边, 菜单选中
                //     asideMenuActive: 'home-tabs',
                //     // 搜索
                //     searchVisible: false,
                //     search: '',
                //     // 侧边管理控制
                //     asideControlOpen: false,


                // appearance: {
                //     headerFixed: false,     // 头部, 固定状态
                //         headerSkin: 'colorful',      // 头部, 皮肤 (white 白色 / colorful 鲜艳)
                //         asideFixed: false,      // 侧边, 固定状态
                //         asideSkin: 'dark',      // 侧边, 皮肤 (white 白色 / dark 黑色)
                //         asideControlFixed: false,       // 侧边管理控制
                //         mainTabsHeaderFixed: false,     // 主标签页
                //         skin: 'orange',
                // }


                this.user = sessionStorage.getItem("user") ? JSON.parse(sessionStorage.getItem("user")) : {};
                this.user = {
                    "accountNonExpired": true,
                    "accountNonLocked": true,
                    "credentialsNonExpired": true,
                    "enable": false,
                    "enabled": false,
                    "jobnum": "tom",
                    "menuUrls": {
                        "menu": [{
                            "urls": [{
                                "gmtModified": 1663641911000,
                                "pagedescribe": "角色管理",
                                "id": 7,
                                "gmtCreate": 1663641907000,
                                "title": "用户信息管理",
                                "url": "/pages/after/role.html",
                                "pagename": "role",
                                "titleflag": "user"
                            }, {
                                "gmtModified": 1663641911000,
                                "pagedescribe": "用户管理",
                                "id": 8,
                                "gmtCreate": 1663641907000,
                                "title": "用户信息管理",
                                "url": "/pages/after/user.html",
                                "pagename": "user",
                                "titleflag": "user"
                            }], "title": "用户信息管理", "titleflag": "user"
                        }, {
                            "urls": [{
                                "gmtModified": 1663641911000,
                                "pagedescribe": "功能管理",
                                "id": 5,
                                "gmtCreate": 1663641907000,
                                "title": "功能管理",
                                "url": "/pages/after/function.html",
                                "pagename": "function",
                                "titleflag": "function"
                            }, {
                                "gmtModified": 1663641911000,
                                "pagedescribe": "功能添加",
                                "id": 6,
                                "gmtCreate": 1663641907000,
                                "title": "功能管理",
                                "url": "/pages/after/functionadd.html",
                                "pagename": "functionadd",
                                "titleflag": "function"
                            }], "title": "功能管理", "titleflag": "function"
                        }, {
                            "urls": [{
                                "gmtModified": 1663641911000,
                                "pagedescribe": "业务处理",
                                "id": 2,
                                "gmtCreate": 1663641907000,
                                "title": "业务功能",
                                "url": "/pages/after/business.html",
                                "pagename": "business",
                                "titleflag": "business"
                            }, {
                                "gmtModified": 1663641911000,
                                "pagedescribe": "业务创建页面",
                                "id": 3,
                                "gmtCreate": 1663641907000,
                                "title": "业务功能",
                                "url": "/pages/after/businesscreate.html",
                                "pagename": "businesscreate",
                                "titleflag": "business"
                            }, {
                                "gmtModified": 1663641911000,
                                "pagedescribe": "业务信息",
                                "id": 4,
                                "gmtCreate": 1663641907000,
                                "title": "业务功能",
                                "url": "/pages/after/businessmsg.html",
                                "pagename": "businessmsg",
                                "titleflag": "business"
                            }], "title": "业务功能", "titleflag": "business"
                        }]
                    },
                    "noLocked": false,
                    "personalization": {
                        "asideFold": false,
                        "mainTabsHeaderFixed": true,
                        "asideControlOpen": true,
                        "headerSkin": "colorful",
                        "headerFixed": true,
                        "skin": "brown",
                        "asideSkin": "dark",
                        "asideControlFixed": true
                    },
                    "username": "tom"
                }

                // console.log(typeof(this.user.personalization))
                console.log(this.user)
                if (typeof (this.user.menuUrls) == "string") {
                    this.user.menuUrls = JSON.parse(this.user.menuUrls)
                }

                // console.log(this.user.menuUrls)

                if (typeof (this.user.personalization) == "string") {
                    this.user.personalization = JSON.parse(this.user.personalization)
                }

                console.log(JSON.stringify(this.user))
                // console.log(this.user.personalization)

                this.appearance.headerFixed = this.user.personalization.headerFixed
                this.appearance.headerSkin = this.user.personalization.headerSkin// 头部, 皮肤 (white 白色 / colorful 鲜艳)
                this.appearance.asideSkin = this.user.personalization.asideSkin
                this.appearance.asideControlFixed = this.user.personalization.asideControlFixed
                this.appearance.mainTabsHeaderFixed = this.user.personalization.mainTabsHeaderFixed
                this.asideFold = this.user.personalization.asideFold//侧边不隐藏
                this.asideControlOpen = this.user.personalization.asideControlOpen
                this.appearance.skin = this.user.personalization.skin

                this.skinChangeHandle(this.appearance.skin);

            }
        });
    })();
</script>
</body>

</html>